package cn.itcast.redisdemo;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
@Slf4j
public class RedisDemoApplication {

    public static void main(String[] args) {
        SpringApplication.run(RedisDemoApplication.class, args);
        log.error("--RedisDemoApplication -- fly --");
    }


    /**
     * 这个bean中配置的就是读写策略，包括四种：
     *
     * - MASTER：从主节点读取
     * - MASTER_PREFERRED：优先从master节点读取，master不可用才读取replica
     * - REPLICA：从slave（replica）节点读取
     * - REPLICA _PREFERRED：优先从slave（replica）节点读取，所有的slave都不可用才读取master
     * */

    // @Bean
    // public LettuceClientConfigurationBuilderCustomizer clientConfigurationBuilderCustomizer(){
    //     return clientConfigurationBuilder -> clientConfigurationBuilder.readFrom(ReadFrom.UPSTREAM);
    // }
}
